package com.example.ex02.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.ex02.entity.University;
import com.example.ex02.service.IUniversityService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class UniversityController {
    private final IUniversityService iUniversityService;

    public UniversityController(IUniversityService iUniversityService) {

        this.iUniversityService = iUniversityService;
    }


    @GetMapping("/university")
    public List<University> selectList() {
        QueryWrapper<University> queryWrapper = new QueryWrapper<>();
        queryWrapper.select("university_name", "province");
        queryWrapper.like("university_name", "山东");
        return iUniversityService.list(queryWrapper);
    }
}
